<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="sealte.hvpms.pojo.UserCreate" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>网上投票管理系统</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/mainPage.css">
<script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/mainPage.js"></script>
<script type="text/javascript">
function unregister(id){
	if(confirm("确定注销账号？这将删除您的所有信息")==true){
		$.post('Unregister',{id:id},function callback(data){
			if(data=='"ok"'){
				alert("注销成功");
				window.location.href="<%=basePath%>";
			}else if(data=='"fail"'){
				alert("注销失败，请联系开发者");
			}	
		});
	}
}
function logout(){
	if(confirm("确定退出？")==true){
		$.post('Logout',null,function callback(data){
			if(data=='"ok"'){
				window.location.href="<%=basePath%>";
			}else{
				alert("退出失败，请联系开发者");
			}
		});
	}
}
</script>
</head>
<body>
<%
	UserCreate uc = (UserCreate)session.getAttribute("UserCreate");
	if(uc!=null){	
%>
<div id="frame_whole">
		<div id="frame_head">
			<table id="table_top">
				<tr>
					<td width="75%" align="left" valign="bottom"><img src="images/banner_inner.png"></td>
					<td width="10%" align="right" valign="bottom">用户：<%=uc.getName() %></td>
					<td width="5%" align="right" valign="bottom">
						[<a href="javascript:logout()">退出</a>]
					</td>
					<td width="10%" align="right" valign="bottom">
						[<a href="javascript:unregister(<%=uc.getId() %>)">注销账号</a>]
						[<a href="util/hvpms_help.html" target="show_frame">帮助</a>]
					</td>
				</tr>
			</table>
		</div>
		<div id="frame_body">
			<div id="left">
				<table id="table_menu">
					<tr>
						<th><img src="images/page.png">&nbsp;投票信息管理</th>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="home/vp_add.jsp" target="show_frame">新增</a></td>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="home/vp_management.jsp" target="show_frame">维护</a></td>
					</tr>
					<tr>
						<th><img src="images/chart_bar.png">&nbsp;投票结果管理</th>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="home/vp_res_management.jsp" target="show_frame">维护</a></td>
					</tr>
					<tr>
						<th><img src="images/user_home.png">&nbsp;个人信息</th>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="home/resetInfo.jsp" target="show_frame">重置资料</a></td>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="home/modifyPassword.jsp" target="show_frame">修改密码</a></td>
					</tr>
					<tr>
						<th><img src="images/messages_view.png">&nbsp;系统消息</th>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="home/messages_viewAll.jsp" target="show_frame">查看</a></td>
					</tr>
				</table>
			</div>
			<div id="middle">
				<input type="button" name="close" id="middlebutton" onclick="middleButton()">
			</div>
			<div id="right">
				<iframe name="show_frame" src="welcome.html"></iframe>
			</div>
		</div>
	</div>
<%		
	}else{
		out.println("谢绝跨路径访问！");
	}
%>
</body>
</html>